package views
{
	import assists.resource.ResourceLoaderData;
	
	import flash.display.Sprite;
	
	import inerface.IViewSpotPanel;
	
	import main.ClientConstants;
	import main.ViewSubBase;
	
	import panel.viewSpots.ViewSpotPanel;
	
	import struct.Scenic;
	
	public class ViewSpotView extends ViewSubBase
	{
		private var _panel:IViewSpotPanel;
		public function ViewSpotView()
		{
			super();
		}
		
		override public function show():void
		{
			data.viewSpot.loadViewSpotData(render);
		}
		
		override protected function render():void
		{
			trace("打开view");
			_panel = new ViewSpotPanel() as IViewSpotPanel;
			_panel.openDetail = openDetailView;
			_panel.init(view.layout.stage,view.resourceLoader,lang,this.data.uri);
			_panel.show(this.data.viewSpot.viewSpotsData.spotList);
			this.addView(_panel);
		}
		
		private function openDetailView(data:Scenic):void
		{
			view.viewSpotDetail.showData(data,ClientConstants.DETAIL_VIEWSPOT);
		}
		
		override public function clear():void
		{
			_panel.clear();
		}
		
	}
}